Before asking for help/feedback on your code, your first step should always be to load it in-game, or at least run it through a Lua syntax checker, and attempting to fix the basic syntax errors. In this case, "if for ... end else ... end" is not valid Lua syntax.
If the TimerTrackerN bars have the same structure as the MirrorTimerN bars, then you can just add them to the existing list of bars the "for ... end" loop should iterate over (on line #3):
Lua Code:
-- mirror castbar!
lib.gen_mirrorcb = function(f)
for _, bar in pairs({'MirrorTimer1','MirrorTimer2','MirrorTimer3','TimerTrackerTimer1','TimerTrackerTimer2','TimerTrackerTimer3'}) do
for i, region in pairs({_G[bar]:GetRegions()}) do
if (region.GetTexture and region:GetTexture() == 'SolidTexture') then
region:Hide()
end
end
_G[bar..'Border']:Hide()
_G[bar]:SetParent(UIParent)
_G[bar]:SetScale(1)
_G[bar]:SetHeight(16)
_G[bar]:SetWidth(280)
_G[bar]:SetBackdropColor(.1,.1,.1)
_G[bar..'Background'] = _G[bar]:CreateTexture(bar..'Background', 'BACKGROUND', _G[bar])
_G[bar..'Background']:SetTexture(cfg.statusbar_texture)
_G[bar..'Background']:SetAllPoints(bar)
_G[bar..'Background']:SetVertexColor(.15,.15,.15,.75)
_G[bar..'Text']:SetFont(cfg.font, 14, "THINOUTLINE")
_G[bar..'Text']:ClearAllPoints()
_G[bar..'Text']:SetPoint('CENTER', MirrorTimer1StatusBar, 0, 1)
_G[bar..'StatusBar']:SetAllPoints(_G[bar])
--glowing borders
local h = CreateFrame("Frame", nil, _G[bar])
h:SetFrameLevel(0)
h:SetPoint("TOPLEFT",-5,5)
h:SetPoint("BOTTOMRIGHT",5,-5)
lib.gen_backdrop(h)
end
end