Small combo code.

Hello. I just need some help figuring out why won’t unity detect that when the left button is pressed the bools that are in the if parameters have to change to “true” from “false”. I leave the code here. I’d be glad if someone helped me on this one.
NOTE: IBA stands for: in between attacks.
NA stands for: Next attack.
using UnityEngine;
using System.Collections;

public class MeeleAttack : MonoBehaviour {

		public bool attack1 =false;
		public bool attack2 = false;
		public bool attack3 = false;
		float IBA = 1.0f;
		float NA = 0.0f;
		bool Combo1 =false;
		// Use this for initialization
		void Awake (){
		}
		void Start () {
		}
		
		// Update is called once per frame
		void Update () {
			if (Input.GetMouseButtonDown (1)){
				attack1 =true;
				NA = Time.time + IBA;
			Debug.Log("Pressed left click.");
			

			}
			if(Input.GetMouseButtonDown(1)&& Time.time <= NA){
				attack2 =true;
				NA = Time.time + IBA;
				Combo1 = true;
			Debug.Log("Pressed left click.");
			
		}
			if(Input.GetMouseButtonDown(1)&& Time.time <= NA&& Combo1 == true){
			attack3 = true;
			Debug.Log("Pressed left click.");
		}
		}
		
	}

I added the debug.log marks to check if the button was detected. Thing is that i get 3 debug logs at the same time, which means that the three ifs are acting at the same time, should i go for a switch case method? Thanks for all the help.

If you do want the player to push the buttton three times to trigger the combo, just invert the order of the ifs:

public class MeeleAttack : MonoBehaviour
{

    public bool attack1 = false;
    public bool attack2 = false;
    public bool attack3 = false;
    float IBA = 1.0f;
    float NA = 0.0f;
    bool Combo1 = false;

    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(1) && Time.time <= NA && Combo1 == true)
        {
            attack3 = true;
            Debug.Log("Triggered attack 3");
        }

        if (Input.GetMouseButtonDown(1) && Time.time <= NA)
        {
            attack2 = true;
            NA = Time.time + IBA;
            Combo1 = true;
            Debug.Log("Triggered attack 2");

        }

        if (Input.GetMouseButtonDown(1))
        {
            attack1 = true;
            NA = Time.time + IBA;
            Debug.Log("Pressed left click.");
        }
    }

}

If you want the combo to be triggered automatically without releasing the button: You are using Input.GetButtonDown() which only trigger at the exact instant the button is pressed. If you want it to trigger whenever the button is mantained use Input.GetButton().