cant change variable from a method? timer stays at 0!

//invulnerable
float invulnerabilityCooldown =2 ;
float invulnerabilityCooldownTimer = 0;
bool invulnerable = false;

void Update() // Update frame-by-frame
    {
Cooldown(isHit,invulnerabilityCooldown,invulnerabilityCooldownTimer);
}
 private void Cooldown(bool condition, float cooldownTime, float timer)
    {
        if (condition)
        {

            timer += Time.deltaTime;
            Debug.Log(timer);
            Debug.Log(condition);
            if (timer >= cooldownTime)
            {
                timer = 0;
                condition = false;
            }
        }
    }

If you want to do it like this you have to pass them by ref

   //invulnerable
      float invulnerabilityCooldown =2 ;
     float invulnerabilityCooldownTimer = 0;
     bool invulnerable = false;
 
 void Update() // Update frame-by-frame
     {
 Cooldown(ref isHit,ref invulnerabilityCooldown,ref invulnerabilityCooldownTimer);
 }
  private void Cooldown(ref bool condition, ref float cooldownTime, ref float timer)
     {
         if (condition)
         {
 
             timer += Time.deltaTime;
             Debug.Log(timer);
             Debug.Log(condition);
             if (timer >= cooldownTime)
             {
                 timer = 0;
                 condition = false;
             }
         }
     }