How do I mask out the underwater effect when inside a building?

Hello, I’m trying to mask out the underwater post-process effect in the water plugin for UE5. I’ve already got the surface to be masked out using the distance to nearest surface node, but I used a tutorial for that and have no clue how to do the same with the underwater effect. Also how do I make the underwater effect less foggy?