replace HurtTime nbt check with something else.

so i have a function that is triggered on "player_hurt_entity" event, i need to give a victim tag to the entity player hit. i was doing it with HurtTime until now, but i wanna optimize it. is there a way to do it without nbt checks? i tried scoreboards, but they dont work for mobs, and then i also tried this

tag @s add attacker
execute as @e at @s on attacker if entity @s[tag=attacker] run tag @e[distance=..0.001] add victim

but since on attacker also works with entities that were hurt long ago, this can give victim to multiple entity that i hit previously

Continue to help post