Only One game object trigger

Hello, I am new to unity and I try to make a tower defence.

When a enemy enter the Collider2D of the tower it will spawn a projectile my problem is when they are multiple same enemy in the area it will spawn projectile faster, my question is their a way to count only one enemy inside the Collider2D or another solution

private void OnTriggerStay2D(Collider2D collision)
{
    if (timer <= 0 && collision.gameObject.tag.Equals("BlueSlime"))
    {
        Instantiate(projectile1, projectileSpawer.transform.position, Quaternion.identity);
        timer = 2;
        Debug.Log("Spawn Projectile");
    }
    else if (timer > 0 && collision.gameObject.tag.Equals("BlueSlime"))
    {
        timer -= 1 * Time.deltaTime;
    }
}

(sorry for my english its not my first language)
Thanks

I guess you have that script attached to the tower. What you can try is to attach the script to the enemy, because then there can’t be multiple Triggers at the same time.