When you repeatedly call hooksecurefunc you will hook the function alot of times, it doesn't overwrite the earlier hooks. I'm not sure what order they're called in but it isn't a good way to do it anyways. I'd do something like:
Lua Code:
local IN_COMBAT
hooksecurefunc(GameTooltip, "SetAction", function(self)
if (IN_COMBAT) then
self:Hide()
end
end)
local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...)
if event == "PLAYER_REGEN_DISABLED" then
IN_COMBAT = true
elseif event == "PLAYER_REGEN_ENABLED" then
IN_COMBAT = false
end
end)
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")