Timer doesn't go down on respawn script

Hello, I made a respawn script that respawns the enemy after a few seconds. It works! However, it doesn’t count down unless I go into the hierarchy and put 3 seconds. Can someone help me with this?

#pragma strict
 
var Health = 100;
var respawnTransform : Transform;
var respawnTimer = 0;
var respawnTime = 3;  
var waitingToRespawn = false;
 
function ApplyDammage (TheDammage : int)
{
    Health -= TheDammage;
 
    if(Health <= 0)
    {
        transform.position = transform.position + Vector3.up*1000; //just need to put him some place off screen
        waitingToRespawn = true;
    }
}
 
function RespawnEnemy()
{
    transform.position = respawnTransform.position;
    transform.rotation = respawnTransform.rotation;
}
 
function Update()
{
    if(waitingToRespawn)
    {
        respawnTimer += Time.deltaTime;
        if(respawnTimer >= respawnTime)
        {
            RespawnEnemy();
            waitingToRespawn = false;
        }
    }
}

Change this

var respawnTimer = 0;

to

var  respawnTimer : float;