Resetting a combo chain

I’m trying to use mecanim to chain combo animations together. My trouble is the counter that I assign in anim will always be 0, because Update() runs much faster than you can click the mouse to increase the counter. Is there a simple way to execute this every fifth update or so, or delay it so the counter can increase properly?

void Update(){

if(Input.GetButtonDown("Fire1")){
   
if (Mathf.Abs(Time.time - nextPunch) < 2){

        switch(punch){

            case 0:
                //This is the first swing in the chain
		punch = punch + 1;
                nextPunch = Time.time + punchRate;
		anim.SetFloat("Punch", punch);
                break;

            case 1:
                //This is the second swing in the chain
				
		punch = punch + 1;
                nextPunch = Time.time + punchRate;
		anim.SetFloat("Punch", punch);
                break;

            case 2:
                //This is the last swing in the chain
		punch = punch + 1;
                nextPunch = Time.time + punchRate + punchDelay;
		anim.SetFloat("Punch", punch);
                break;
         }
	  }
	} 
	else {
         punch = 0;
	 nextPunch = 0.0f;

    }

}

A counter system is pretty easy. Just create a counter, threshold, and test:

int counter = 0;
int threshold = 5;

void Update()
{
    if(++counter <= threshold) return;
    counter = 0;
    //rest of your code

}

This will only run the update every 5 times.

Now, while that answers your question, it is probably not great to delay the update method. You might be doing other important things in there. Instead, you would want to delay only the resetting of the combo. You would also want to do it based on time and not a set number of updates. For example, if you wanted to reset the counter every half second:

float counter = 0;
float threshold = .5f;

void Update()
{
    counter += Time.deltaTime;
    if(counter <= threshold) return;
    counter -= threshold;

    //rest of your code

}