Code:
local onEvent = function(s,e,_,c,_,g,_,_,_,_,_,_,_,i) -- hope i counted correctly
if (c == "SPELL_CAST_SUCCESS") and (i == 42292) and (g == UnitGUID(s.unit)) then -- i'm not sure if srcguid or dstguid is the caster in this case. use arg10 instead of arg6 for g in the function header if this doesn't work.
CooldownFrame_SetTimer(s.c,GetTime(),120,1)
end
end
local function create(parent,unit,size,point,xOff,yOff)
local f = CreateFrame("Frame",nil,parent)
f:SetSize(size,size)
f:SetPoint(point,xOff,yOff)
f.unit = unit
f:SetScript("OnEvent",onEvent)
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f.c = CreateFrame("Cooldown",nil,f)
f.c:SetAllPoints()
f.t = f:CreateTexture(nil,"BACKGROUND")
f.t:SetAllPoints()
f.t:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_02")
end
-- call create for every UF here (or in ADDON_LOADED or whatever is applicable for the addon in question. you could also make a global function and call that in the UF's OnLoad if supported. lots of options.)
Drycoded. Post back if there's issues.