The water material is not changing the vertex data, it is a customized shader.
I guess you could see the calculation the water shader does and implement it in JS? I have no better suggestion, but maybe the wonderful souls in this forum have a smarter suggestion
That appears to be the way it has been solved before using the equation from the shader in JS - which works when looking at the water height at position 0,0 but seems to break elsewhere…