Actionscipt-3: Making Variables stay the same
===

I am trying to make a game in which a button is clicked, and 45 health points from a healthbar goes down. I have all my coding, and it works well, but I want to make the button so that if health is less than 45, nothing is taken from the health bar. I tried using:   

    if(health < 45) health = health;

But it did not work out. I have a feeling the solution to this problem is easy, but I just can't figure it out. Obviously, I am very new at this all, and still find it hard to wrap my head around some concepts. This is my coding: 

    fortyfivedown_btn.addEventListener(MouseEvent.CLICK, fortyfivedownClick);
    
        var health:int = 100;
        
        lifebar.gotoAndStop(101);
        
        function fortyfivedownClick(event:MouseEvent):void{
            health -= 45;
            if(health < 0) health = 0;
            else if(health > 100) health = 100;
        
            lifebar.gotoAndStop(health + 1);
        }

Any help would be appreciated, and thank you for your time.