For a counter of enemies, set one of the entity skills to a unique enemy value, and then use an ent_next loop to count all entities that have that skill set. This is much easier done than complicated array handling.