Attack when leaving ships (4)
I believe the answer is:
sail
'ships' is the definition.
(I've seen this before)
'attack when leaving' is the wordplay.
'attack' becomes 'assail' (synonyms).
'when' becomes 'as' (eg 'when I walked' means 'as I walked').
'leaving' indicates named letters should be taken away.
'assail' with 'as' removed is 'SAIL'.
(Other definitions for sail that I've seen before include "Travel on water propelled by wind" , "Spanker, say" , "Glide along" , "Travel by ship" , "Travel by boat" .)