execute as @s[predicate=survivalplus:illagerhat] unless score @s illager matches 1.. run team join illager
execute at @s[predicate=survivalplus:illagerhat,team=illager] run data modify entity @n[type=iron_golem,nbt=!{PlayerCreated:1b},distance=..10] AngryAt set from entity @s UUID
execute at @s[predicate=survivalplus:illagerhat,team=illager] as @n[type=iron_golem,nbt=!{PlayerCreated:1b},distance=..10] if data entity @s {AngerTime:0} run data modify entity @s AngerTime set value 10