This is a quick re-hash of the old code and seems to work for me.
The FocusFrame's buff handling piggybacks off of
TargetFrame_UpdateAuras by being passed into the function as the self argument. My code identifies the name of the frame that self is referring to, and uses that to look up the appropriate icon frame to hide.
Simple enough, this has been happening in the background of this script the entire time, there has just been no work done to the FocusFrame's buff icons.
Lua Code:
hooksecurefunc("TargetFrame_UpdateAuras", function(self)
for i = 1, MAX_TARGET_BUFFS do
local _, _, icon, _, dispelType = UnitBuff(self.unit, i)
if (icon and (not self.maxBuffs or i <= self.maxBuffs) ) then
if (dispelType ~= "Magic") then
_G[self:GetName().."Buff"..i]:Hide()
end
end
end
end)