execute store result score defense maxhp run attribute @s minecraft:armor get
attribute @s attack_damage modifier remove ef25bbbf-cd0c-4520-8442-095cabbbb637
execute if score defense maxhp matches 0 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 1 add_multiplied_base
execute if score defense maxhp matches 1 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .91 add_multiplied_base
execute if score defense maxhp matches 2 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .83 add_multiplied_base
execute if score defense maxhp matches 3 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .74 add_multiplied_base
execute if score defense maxhp matches 4 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .65 add_multiplied_base
execute if score defense maxhp matches 5 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .56 add_multiplied_base
execute if score defense maxhp matches 6 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .47 add_multiplied_base
execute if score defense maxhp matches 7 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .36 add_multiplied_base
execute if score defense maxhp matches 8 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .27 add_multiplied_base
execute if score defense maxhp matches 9 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .18 add_multiplied_base
execute if score defense maxhp matches 10 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 .09 add_multiplied_base

execute if score defense maxhp matches 12 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.1 add_multiplied_base
execute if score defense maxhp matches 13 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.15 add_multiplied_base
execute if score defense maxhp matches 14 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.2 add_multiplied_base
execute if score defense maxhp matches 15 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.25 add_multiplied_base
execute if score defense maxhp matches 16 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.3 add_multiplied_base
execute if score defense maxhp matches 17 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.35 add_multiplied_base
execute if score defense maxhp matches 18 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.4 add_multiplied_base
execute if score defense maxhp matches 19 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.45 add_multiplied_base
execute if score defense maxhp matches 20 run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.5 add_multiplied_base
execute if score defense maxhp matches 21.. run attribute @s attack_damage modifier add ef25bbbf-cd0c-4520-8442-095cabbbb637 -0.75 add_multiplied_base
scoreboard players reset defense
#advancement revoke @s only survivalplus:tools/tick/nodefatkup