
-- XPerl
if XPerl_CooldownFrame_SetTimer then
	XPerl_CooldownFrame_SetTimer = CooldownFrame_SetTimer
end

-- TrinityBars
if IsAddOnLoaded("TrinityBars") then
	function tCC_ButtonGetType(button)
		local name = button:GetName()
		if string.find(name, "^SpellButton") then
			return tCC_Type.spell
		elseif string.find(name, "^TrinityActionButton") then
			return tCC_Type.action
		elseif getglobal(name.."AutoCastable") then
			return tCC_Type.pet
		elseif getglobal(name.."HotKey") then
			return tCC_Type.action
		elseif getglobal(name.."Stock") then
			return tCC_Type.item
		else
			return tCC_Type.buff
		end
	end

	tdOld_Trinity_UpdateActionbar_OnEvent = Trinity_UpdateActionbar_OnEvent
	function Trinity_UpdateActionbar_OnEvent(button)
		local start, duration, enable = GetActionCooldown(this:GetID());
		if getglobal(this:GetName().."IconFrameCooldown") then
			CooldownFrame_SetTimer(getglobal(this:GetName().."IconFrameCooldown"), start, duration, enable);
		end
		tdOld_Trinity_UpdateActionbar_OnEvent(button)
	end
end