If your goal is just "make this thing the same color as that other thing, always" then you shouldn't be rewriting tons of code -- just grab the color from "that other thing" and apply it to "this thing":
Lua Code:
hooksecurefunc(ThatOtherThing, "SetStatusBarColor", function(self, ...)
ThisThing:SetVertexColor(...)
end)
You should be able to put that in your OnLoad script, as long as "that other thing" already exists when your panel loads.
Also, the above code assumes that "that other thing" is actually a StatusBar object. If it's just a texture, you'd need to hook SetVertexColor instead of SetStatusBarColor.