The AI script does not work properly

The AI script :up-enemy-units-in-town

it does not work properly,It always returns 0 or 1.although there is more than one unit

and I’m not sure it works properly or not.such as : “up-enemy-buildings-in-town”、up-enemy-villagers-in-town