The screenshot attached above is an example of how doing the most damage or being the closest has no effect whatsoever on what the computer does.

My warrior is the only one who did any damage. The mage was stealthed for a few turns, then cast a summon. The computer immediately ran away from my warrior and even passed the summon, although one or two of the demons did hit the summon once on their way to my mage (guess they had AP to spare).

The entire game, the only time my warrior ever takes a hit is when she's close enough to the rest of the party to be hit by AoEs, or the only party member close enough to be hit in that turn. It doesn't seem to matter if the warrior is closest, or if she's the first to engage combat/first character in sight.

I beat that fight very, very easily. I kept my mage and ranger in stealth, out of the fight, and let my warrior solo the entire group. Funnn.