@name DamageDetectingExample
@inputs DMG:wirelink Prop:entity 
@outputs On
@persist HP:number 
@trigger 
interval(100)

if (first() | dupefinished()) {
    HP = 100
    On = 1
}

if(changed(DMG["Clk",number])){HP-=DMG["Damage",number]}

if ((HP) & HP <= 0) {
    Prop:propDelete()
}
