Alright mates, im here today to ask for some help! I've gathered many scripts/addons over the years but i dont know how to edit them, or even if its possible!

Exemple: i have 2 scripts to modify the healthbar color, and they can't work together, but i want to!

Script 1: I would like this script to modify every existing healthbar, except mine and pets

local function colour(statusbar, unit)
local _, class, c
if UnitIsPlayer(unit) and UnitIsConnected(unit) and unit == statusbar.unit and UnitClass(unit) then
_, class = UnitClass(unit)
c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
statusbar:SetStatusBarColor(c.r, c.g, c.b)
PlayerFrameHealthBar:SetStatusBarColor(0,1,0)
end
end

hooksecurefunc("UnitFrameHealthBar_Update", colour)
hooksecurefunc("HealthBar_OnValueChanged", function(self)
colour(self, self.unit)
end)


Script 2: I would like this one to affect only my healthbar and pets healthbar

function ColorHealthBar_OnLoad()
DEFAULT_CHAT_FRAME:AddMessage("Colour HealthBar 2.0 loaded!");
CHB_Old_OnValueChanged = HealthBar_OnValueChanged;
HealthBar_OnValueChanged = CHB_OnValueChanged;
end

function CHB_OnValueChanged(self, value, smooth)
CHB_Old_OnValueChanged(self, value, true);
end


Do you think its possible?

Thanks in advance guys :D