Using a hidden collision object is the right way to go, so your character can still get hit (e.g. from behind) when he is attacking. Create a sprite that mimics the animation of the sword swing, but only contains the blade, call it sword mask and make it hidden.
Then, when you initiate the sword attack, spawn your sword mask using an image point to line it up correctly. You can set up collision events between the sword mask and members of the enemy family to do damage to the enemies, but you can still have the enemies hurt the samurai if they attack from behind. Then you just need to remove the sword mask when the samurai attack animation finishes.
Although, I should point out, this is completely untested.