I had some tree frogs for about 5 years. They were in a huge terrarium that included a 20 gallon water section. For the most part they did not bother with the water, except at night they would sit with their heads out of the water and their bodies submerged. And like you say, if frightened they would dive into the water. I was very surprised at how adept they were under water. The kind of sunk to the bottom then they would crawl around as if on land until they found a hiding spot. I had a little bit of flow on half of the water section, and they would get "churned around" a bit, but as long as there was enough open water they seemed to just ride it out to the bottom and then they were fine.