execute if entity @s[tag=player,nbt=!{OnGround:1b}] run attribute @s attack_damage modifier add fde9e307-8196-49c9-bd39-35a53936ef11 0.5 add_multiplied_base
execute if entity @s[tag=player,nbt={OnGround:1b}] run attribute @s attack_damage modifier remove fde9e307-8196-49c9-bd39-35a53936ef11
execute if entity @s[tag=!player] run attribute @s attack_damage modifier remove fde9e307-8196-49c9-bd39-35a53936ef11
execute as @s store result score @s siphon run data get entity @s Health
execute if entity @s[tag=!hp50pass] run function survivalplus:finale/boss/50
execute if entity @s[tag=hp50pass,tag=!halfhp] run function survivalplus:finale/boss/halfhp
execute if entity @s[tag=!hp20pass] run function survivalplus:finale/boss/20
execute if entity @s[tag=hp20pass] run function survivalplus:finale/boss/lowhp
execute if entity @s[tag=yoinkph,tag=!lowhp] at @s run particle angry_villager ~ ~2 ~ .1 .1 .1 0 1

execute at @s[tag=skullbow] anchored eyes as @e[type=arrow,distance=...5] run function survivalplus:finale/boss/skullbow
execute at @s[tag=tim] anchored eyes if entity @e[type=ender_pearl,distance=...5] run schedule function survivalplus:finale/boss/cycle 1.5s replace

execute if entity @e[tag=bosshealer] as @e[tag=bosshealer] run function survivalplus:finale/boss/crystal
execute at @s if entity @s[tag=heal,nbt={HurtTime:10s}] unless entity @e[tag=bosshealer] unless entity @e[tag=bosshealcloud,distance=..3] run summon area_effect_cloud ~ ~.5 ~ {Particle:{type:dust,color:[0,0,0],scale:2},potion_contents:{custom_effects:[{id:instant_damage}]},Radius:0.5,RadiusPerTick:0.1,Duration:40,Tags:[bosshealcloud]}
execute if entity @s[tag=heal] unless entity @e[tag=bosshealer] at @e[tag=ng+portal] run setblock ~ ~8 ~ air destroy