When you simulates searching enemy in trigger, you do some sort of:
Pick each unit in region entire map, with filters... for e.g. player = pc
Set variable AttackerUnit = picked unit
Set variable MinHP = 1
pick each unit in region (circle at point position of AttackerUnit with radius 6)
Now we will do priority sorting. For example i'd like to select target enemy with lowest percent hp.
1. Get picked unit property hp percent current
2. if picked unit property hp percent current < MinHP then
Set variable MinHP = picked unit property hp percent current
Set variable TargetUnit = picked unit.
after this sorting, we will receave TargetUnit with smaller hp percent. and we can order AttackerUnit order Attack TargetUnit.