I think I sort of fixed the beam height problem in ur map, it works across water and different cliff heights, it does not detect unit z height though so it will look a bit wonky during transitions like ramps or very uneven terrain, here is the map, and here are the parts I've edited:
https://www.hiveworkshop.com/pastebin/44014e098dcaedd8b7c769023326798214881/
https://i.gyazo.com/49ec66f09c0571be4c1a51e1d9106ca0.png
https://i.gyazo.com/2eae3d65038a5e14c1c8ad3f656ecb6e.png
https://i.gyazo.com/7a6eeaaeb8a640202f12a0296341b662.png
Work on in may still be needed for the special effects, caster offset height and auxiliary turret
https://www.hiveworkshop.com/pastebin/44014e098dcaedd8b7c769023326798214881/
https://i.gyazo.com/49ec66f09c0571be4c1a51e1d9106ca0.png
https://i.gyazo.com/2eae3d65038a5e14c1c8ad3f656ecb6e.png
https://i.gyazo.com/7a6eeaaeb8a640202f12a0296341b662.png
Work on in may still be needed for the special effects, caster offset height and auxiliary turret
It's on the Persistent Beam page.