OnTriggerStay (105593)

I have a little problem with OnTriggerStay. I have box as trigger and want to deal damage to all enemies inside that box every 1s , but only 1 of them takes damage , if 1 is killed secound one is taking damage and so forth. How to do that for all enemies inside trigger?(I dont want to use overlapsphere)

using UnityEngine;
using System.Collections;

public class FlameThrower : MonoBehaviour {
	public int DamageMin;
	public int DamageMax;
	private float cdCounter;
	public float CoolDown = 1;
	public ParticleSystem Fire;

	// Use this for initialization
	void Start () { 
		Fire.enableEmission = false;
	}
	
	// Update is called once per frame
	void Update () {
		if (cdCounter > 0) 
		{
			cdCounter -= Time.deltaTime;
		}
	}

	void OnTriggerEnter(Collider col)
	{
		if (col.tag == "Enemy") 
		{
			Fire.enableEmission = true;
		}
	}

	void OnTriggerExit(Collider col)
	{
		if (col.tag == "Enemy") 
		{
		 Fire.enableEmission = false;
		}
	}

	void OnTriggerStay(Collider col)
	{
		Fire.enableEmission = true;
		if(cdCounter <= 0)
		{
		col.GetComponent<Health>().health -= Random.Range(DamageMin,DamageMax);
		cdCounter = CoolDown;
		}
		//print (col.gameObject.name);
	}
}

As i noticed only last one enemy entering trigger takes damage (every 1s as i want).
Thanks in advance.

My guess would be that this has to do with your cdCounter variable. OnTriggerStay is called for all objects in the trigger volume. However after the first OnTriggerStay call for the first enemy you set cdCounter to CoolDown. For the second enemy OnTriggerStay hits the statement if(cdCounter <= 0) which is now false and will not apply damage.

What you need to do is damage all enemies first then set the counter.

void OnTriggerStay(Collider col)
{
   Fire.enableEmission = true;
   if(cdCounter <= 0)
   {
   col.GetComponent<Health>().health -= Random.Range(DamageMin,DamageMax);
   damagedEnemies = true;
   }
   //print (col.gameObject.name);
}

void OnUpdate()
{
    if(cdCounter > 0)
    {
        cdCounter -= Time.Dt;
    }

     if(damagedEnemies)
    {
        cdCounter = CoolDown;
        damagedEnemies = false;
   }

}

Thanks for ur reply victu , damage problem solved but i have another question. How to start emit Fire when enemies are inside trigger, and stop emit when there are no enemies inside trigger? Was trying with bool but idk why it stays with true all the time when 1st enemy entered trigger.