If you want you can use the fact that the UpdateAuraPositions(at tail-end of UpdateAuras) loops through the buffs as well. Works great for hiding or repositioning those squirmy target de/buffs and adding timers.
Code:
hooksecurefunc('TargetFrame_UpdateBuffAnchor', function(self, name, index, ...)
if name == 'TargetFrameBuff' then
local _, _, _, debuffType, _, _, _, _, _, id = UnitBuff(unit, index)
if not id then return end
local stealable = _G[name .. "Buff" .. index .."Stealable"]
if not stealable then return end
stealable:SetShown(debuffType == "Magic" and spellIDs[id])
end
end)