The problem with the pseudo-array is the lack of a timestamp. I can look into your suggestion about measuring time out of combat as an alternative to a timestamp. Perhaps that would be best.
So you're concerned about someone damaging a mob, running away, the mob not getting despawned, and then someone else killing the mob but the original player gets XP too? I'd just do a semi-recursive script on the EndCombat event -- delay 6 seconds and see if we're in combat. If so, return. Otherwise, delay another 6 seconds and if we're still not in combat then clear the pseudo-array. Could adjust the time as needed, ideally could just clear the array as soon as combat drops for the NPC but if that happens accidentally while the PCs are still fighting it somehow then a failsafe would be nice.
I considered using the attack event as well, but don't see how a character can be considered to have meaningfully contributed if they attack but never damage the NPC. More important would be to include PCs who have been attacked.
Whizard gave some examples there -- and if you're a low level wizard attacking with a crossbow you very well might not ever hit the NPC OR get attacked by the NPC (since it's attacking the fighter).
As for #1, I mentioned to MM that recording when a creature attacks a PC is important. I'm just not sure where the best place to capture this is. I wish PCs had the same events that creatures do. Thoughts on how to achieve this?
The way you're trying to do this now causes a whole host of problems.
1. A fighter and wizard are killing a group of six mobs. The fighter rounds them up and the wizard nukes them down -- but the fighter only has the chance to attack one out of the six so he only gets credit for one out of the six.
But let's say you fix that given your quote.
2. A fighter, rogue, and wizard are killing a group of six mobs. The fighter rounds them up, the wizard starts AoEing, and the rogue picks them off one by one. But the rogue only has the chance to attack three of the six mobs (and never gets attacked by any) and only gets credit for half of them as a result.
So here's an idea. When the NPCs gets attacked/damaged/spellcastat/etc, see if a local object exists for an enemy PC. If not, set it to the enemy PC. If there is, the mob is "tagged" and we ignore another PC attacking it in terms of XP. Then when it dies check the PCs for all PCs in the same faction of the local object who are within 40 yards and give them the XP. We clear the local object when combat ends (or after a 6/12/whatever second delay to prevent oddities) to allow re-tagging.
This means all members of a party within 40 yards of an NPC will receive XP if a member of their party was the first to attack/damage/spellcastat/etc a given mob -- can't swoop in and steal XP on kills.