do

local oldUnit=Unit
Unit = Class(oldUnit) {
OnStartBuild = function(self, unitBeingBuilt, order)
                oldUnit.OnStartBuild(self, unitBeingBuilt, order)
               
                if order == 'MobileBuild' then
                        local LowerCostUnits = {
                                'brmt1beetle', 'brmt2beetle', 'brmt1expd',
                                'brmt1expdt2', 'brmt2epd', 'brmt2medm',
                                'brnt1expd', 'brnt2bm', 'brnt1exart',
                                'brnt1exmob', 'brnt2epd', 'brnt2exart',
                                'brnt2exlm', 'brnt2exm1', 'brnt2exm2',
                                'brot1extank', 'brot1expd', 'brot2exth',
                                'brot2exbm', 'brot2exm2', 'brot2epd'
                        }
                        local UBBBPID = unitBeingBuilt:GetBlueprint().BlueprintId
                        local mult = 0.25
                       
                        if table.find(LowerCostUnits, UBBBPID) then
                                local AIBrain = self:GetAIBrain()
                                if AIBrain.BrainType != 'Human' then
                                        WARN('--> builder is building ' .. repr(UBBBPID).. ' apply mult value to econ')
                                        self.EconChangedForIA = true
                                        self.EconChangedForIAValues = { Energy = self.EnergyBuildAdjMod, Mass = self.MassBuildAdjMod }
                                        self.EnergyBuildAdjMod = mult
                                        self.MassBuildAdjMod = mult
                                        self:UpdateConsumptionValues()
                                end
                        else
                                if self.EconChangedForIA then
                                        local LastValues = self.EconChangedForIAValues
                                        self.EnergyBuildAdjMod = LastValues.Energy or nil
                                        self.MassBuildAdjMod = LastValues.Mass or nil
                                        self:UpdateConsumptionValues()
                                        self.EconChangedForIAValues = nil
                                        self.EconChangedForIA = nil
                                end
                        end
                end
        end,
}

end