Make a debug mode where hotboxes and hurtboxes for everything (boss, sword, player, etc) are visible.
Things you need to fix should be obvious.