How can I make the player have infinity jumps while is inside the "Water" layer?

I need the player to have infinity jumps while its inside the “Water” layer as a swimming mechanic. I think you just changing the players layer to ground while its in the water but I don’t know how to do it and I don’t know any other way.