if (!miss) ApplyDamage(target, target.transform.position, vector32, target);should be
if (!miss) ApplyDamage(target, target.transform.position, vector32, npc.player);this solves an issue where the player is set as the initiator, when the npc should be set as the initiator
thanks