https://wow.gamepedia.com/API_GameTooltip_SetOwner
Lua Code:
local function SetDefaultAnchor(self, parent)
local xOffset, yOffset = 0, 0
if InCombatLockdown() then
self:SetOwner(parent, "ANCHOR_NONE")
else
self:SetOwner(parent, "ANCHOR_CURSOR", xOffset, yOffset)
end
end
hooksecurefunc("GameTooltip_SetDefaultAnchor", SetDefaultAnchor)
Put the above in here and give your addon a desired name.
https://addon.bool.no/