tag @s add deadweight_active
execute store result score @s deadweight_movement_speed_base run attribute @s movement_speed base get 100
execute store result score @s deadweight_movement_speed_current run attribute @s movement_speed get 100
execute store result score @s deadweight_missing_movement_speed run scoreboard players operation @s deadweight_movement_speed_base -= @s deadweight_movement_speed_current
execute store result storage kiwi:deadweight_additional_scaling x int 3 run scoreboard players get @s deadweight_missing_movement_speed
execute store result score @s deadweight_show_damage_bonus run data get storage kiwi:deadweight_additional_scaling x 1
attribute @s movement_speed modifier remove deadweight_movement_speed_active

data modify entity @s Inventory[{Slot:102b}].components."minecraft:lore" append value '{"text":"test","italic":false}'

execute as @e[type=#enemy_mobs_only,nbt={HurtTime:10s},limit=1,sort=nearest] at @s run tag @s add deadweight_target
execute if entity @e[tag=deadweight_target] run tellraw @s [{"text": "[Deadweight] ","color": "dark_gray"},{"text": "Dealt ","color": "gray"},{"score": {"name": "@s","objective": "deadweight_show_damage_bonus"},"color": "yellow"},{"text": " damage to ","color": "gray"},{"selector": "@e[type=#enemy_mobs_only,nbt={HurtTime:10s},limit=1,sort=nearest,tag=!deadweight_invulnerability,tag=deadweight_target]","color": "red"},{"text": "!","color": "gray"}]
execute as @e[type=#enemy_mobs_only,nbt={HurtTime:10s},limit=1,sort=nearest,tag=deadweight_target] at @s run function kiwi3:relics/deadweight/deadweight_delayed_hit

kill @e[type=marker,tag=deadweight_marker]