Help with Timers?

I’m currently attempting to make an Energy bar increase over time. If mcBox is hit by mcBall, I want mcEnergy to decrease by 300 and then continue to increase. At the moment, when mcBox is hit by mcBall, the mcEnergy’s width stops completely and does not minus by 300. Once the mcBall is away from the mcBox, it continues to increase. This is the code I’ve got so far. I’m not sure how to make this happen. All the functions included are being called in a separate function which loops using ENTER_FRAME. Help please!?


////////////////////////////////// Timers ////////////////////////////////////////////


var energyTimer:Timer = new Timer(200); // create a new timer interval
energyTimer.addEventListener(TimerEvent.TIMER, energyControl)
energyTimer.start(); // start the timer


var increaseEnergy:Number = 0; // set maximum time amount


var energyIncreaseConstantly = false;

///////////////////////////////// Timer Functions //////////////////////////////


function energyControl(event:TimerEvent)
{
    if(energyIncreaseConstantly == true)
    {
            if(mcEnergy.width >= 300)
            {    
                energyTimer.stop();
            }
        
            increaseEnergy += 5
            mcEnergy.width = increaseEnergy    
    }
    
    
}


function EnergyIncreaseConstantlyEqualsTrue()
{
    if(mcEnergy.hitTestObject(mcEnergyTrue))
    {
        energyIncreaseConstantly = true;
    }
}


function ifEnergyIncreaseConstantlyEqualsFalse()
{
    if(energyIncreaseConstantly == false)
    {
        mcEnergy.width -= 300;
    }
}


function EnergyIncreaseConstantlyEqualsFalse()
{
    if(mcBall.hitTestObject(mcBox))
    {
        energyIncreaseConstantly = false;
    }
    
}