execute store result score @s scientist.capsule.health run data get entity @s item.components."minecraft:max_damage"
execute store result score @s scientist.capsule.use run data get entity @s item.components."minecraft:damage"
execute store result entity @s item.components."minecraft:damage" int 1 run scoreboard players add @s scientist.capsule.use 1
execute if score @s scientist.capsule.use = @s scientist.capsule.health run function ws:work/misc/tier2/scientist/breakcapsule