execute at @e[tag=upgradekit] if entity @e[tag=upgradeable,distance=..1] run tag @n[tag=upgradeable,tag=!upgrade,tag=!upgraded] add upgrade
execute at @e[tag=upgradekit] if entity @e[tag=upgrade,distance=..1] as @n[tag=upgrade] at @s run function survivalplus:mobs/upgrade/upgraded