On top of the option of holding e to using your ship attachment you should also give the option of holding f to detaching the ship attachment to be able to hold and use it.
You can shoot the ship attachment and you press f to unequip / equipping it by putting it in your behind back or back in your hand ready for use.
Then you can attack the ship attachment back by holding f at where the ship attachment was detached.
And on death the ship attachment is automatically removed from you and attached back on ship
By the way party members of the owner of the ship should be allowed to detach and attach ship attachments too.
The benefits of this is.
-It allow heat/cold / any magic that is unusable underwater to be able to kill sharks
-Allows us to use ship attachments fluidly by allowing us to better position to aim / use the attachments together
-It allows us when underwater to kill sea monsters while still getting full drop chance