In jass is the the perfect way to detect if a unit is damaged and has a particular buff?
JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
if (GetUnitAbilityLevel(GetTriggerUnit(), 039;B000039;) > 0) then
if (GetUnitAbilityLevel(GetTriggerUnit(), 039;B001039;) > 0) then
call DisplayTextToForce( GetPlayersAll(), "detect" )
endif
endif
endfunction