I don't have a script solution, but I tried around a bit in src.
In battle.cpp in the battle_damage function, if you find:
if (src)
sd = BL_CAST(BL_PC, src);
and replace it with:
if (src) {
sd = BL_CAST(BL_PC, src);
unit_data* ud = unit_bl2ud(target);
if (src->type == BL_PC && target->type == BL_PC && ud != nullptr && ud->target_count >= 2)
status_change_start(target, src, SC_DECREASEAGI, 10000, 10, 0, 0, 0, 10000, SCSTART_NOAVOID);
}
It's kinda working. However, it only counts autoattackers, not players that use skills on the target. If there are already 2 auto attackers and someone attacks with skill, they also get cursed, though.
Would be easier to do if we had the official system of counting attackers that adds them to a list and then deletes them after 3000ms again.