Swimming npcs

Hi, so  this is my first time asking for something that isnt already on the forums that I can see.
So i have enemy NPC's that start a battle on contact, because i dont like random enemy encounters, but the events themselves

are set to approach the player, normally this is ok, but when the player is in water (i.e on a boat) the npcs cant move.
I've tried setting them to "passable" but this means they can walk over the region restrictions i've placed around the shore. Is there any way to make npc's able to move in water, but not ghost through walls and come on land?
You could use Yanfly's Move Restrict Region script:

https://yanflychannel.wordpress.com/rmvxa/field-scripts/move-restrict-region/
Thanks, but I've tried that. The npc's have to be set to 'through' to allow them to move on water, but this lets them move through the region barrier. The only way to stop them is using the 'all restrict', but this means the party cant get out of the boat either! 
Maybe use a duplicate tileset where the water tiles passability is set to on, so you don't need to use 'through'?
i would do that, but it seems awfully complicated for something that must be so simple, plus if i set the water tile to passable, the boat wont be able to pass through it (because it will recognise it as a land tile right?) and even though the boat only sets off from one spot, there are several islands with large coastlines where the  player could get out, so setting an event around all of the tiles would take days
I suppose what i need, is where on Yanfly's script do i change to make npc restrict work, even when through=on
Did you test this one?

http://rmrk.net/index.php?topic=44717.0
That seems to work yes! Thankyou!

Original thread: https://forums.rpgmakerweb.com/threads/swimming-npcs.39986/