Apologies, i now see the error in the code i posted in post #15, which for some reason hid from me.
i like the approach Pas has posted... Less if and function calls can only help.
although i would add [Ticker = -1], with out it, the loop won't stop.
You also don't need the [duration, expires] variables anymore
Lua Code:
local function UNIT_AURA()
if UnitDebuff("player", TaintOfTheSea) then
if not debuffexists then
debuffexists = true --player just got the debuff
Ticker = 8
UpdateTicker()
end
else
Ticker = -1
debuffexists = false -- doesn't exist
end
end