The 6th and 7th return of UnitAura are duration (in seconds) and expiration (the moment in time when the aura will expire). For every aura you want to track, you create a statusbar widget and set its properties like so:
lua Code:
bar:SetMinMaxValues(0, duration)
bar.timeLeft = expiration - GetTime()
bar:SetScript('OnUpdate', UpdateTimer)
bar:Show()
The UpdateTimer function should look something like that:
lua Code:
local function UpdateTimer(bar, elapsed)
local timeLeft = bar.timeLeft - elapsed
if(timeLeft > 0) then
bar:SetValue(timeLeft)
bar.timeLeft = timeLeft
else
bar:Hide()
end
end
Edit: remember to re-use your statusbars. Create new ones only if needed.