I assumed you were an Eminem fan, or at least knew a part of that song other than the chorus.
if IsUnitEnemy(u, GetOwningPlayer(HERO)) and GetWidgetLife(u)/GetUnitState(u, UNIT_STATE_MAX_LIFE) < 0.3 and IsUnitType(u, UNIT_TYPE_HERO) then
//DoStuff
endif
function Check takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u, GetOwningPlayer(HERO)) and GetWidgetLife(u)/GetUnitState(u, UNIT_STATE_MAX_LIFE) < 0.3 then
//DoStuff
endif
return false
endfunction
function Start takes nothing returns nothing
call GroupEnumUnitsInRange(GROUP, GetUnitX(HERO), GetUnitY(HERO), 2500, function Check)
endfunction
function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 1.00, true)
call TriggerAddAction(t, function Start)
endfunction