execute as @a at @s if score @s cooldown matches 1 run effect give @a[distance=..400] minecraft:regeneration 8 1
execute at @s if score @s cooldown matches 1.. run scoreboard players remove @s cooldown 1