$execute unless entity @n[type=block_display,tag=$(id)_$(character)_$(type)_projectile,scores={pierce=1..}] run return fail

$execute unless score @s $(id)_$(character)_$(type)_hit_cooldown matches 1.. run scoreboard players set @s $(id)_$(character)_$(type)_hit_cooldown 0

$execute at @s[scores={$(id)_$(character)_$(type)_hit_cooldown=..0}] run function main:mechanics/projectile/pierce {"id":$(id),"character":$(character),"type":$(type)}

$execute at @s[scores={$(id)_$(character)_$(type)_hit_cooldown=..0}] run function main:$(folder_location)/projectile_hit

$execute at @s[scores={$(id)_$(character)_$(type)_hit_cooldown=..0}] run function main:mechanics/artifacts/inputs/on_hit_projectile {"character":"$(character)"}

$execute if entity @s[scores={$(id)_$(character)_$(type)_hit_cooldown=..0}] run scoreboard players set @s $(id)_$(character)_$(type)_hit_cooldown 5