Also, you really don't need half those variables you're defining... if you're only going to use a value once, just use it. You don't need to assign one variable's value to another variable before you can use it. I'm also extremely confused about the logic behind doing "-1 * (x - y)" instead of just "y - x" when that's what you really want... o_O
Code:
for i = 1, 40 do
local _,_,_,_,_,_,expirationTime,_,_,_id = UnitBuff(u, i)
if id == 20925 then
local timeLeft = expirationTime - GetTime()
if timeLeft > 0.5 then
return format("|cfffdff52%.0f|r", timeLeft)
end
elseif not id then
-- no more buffs to look at
return
end
end