#say tag! 
execute at @s as @e[distance=..8] store result score @s nl.DetectEntity run data get entity @s HurtTime
execute at @s as @e[distance=..8] if score @s nl.DetectEntity matches 10.. run tag @s add nl_Hit_by_Player 
execute as @e[tag=nl_Hit_by_Player] run function next_level:combat/custom_enchant
scoreboard players set @s nl.DetectDamage 0