opposite to execute on attacker

trying to get an execute on attacked like feature, like a simple lightning sword for example. have a player hurt entity advancement, but is there any way to target the entity that the player hurt in the function rewarded?
Continue to help post