So if I'm reading this right, this switch here derails any/every mod_pain call.  Great idea, glad you knew the code well enough to do it.

Asking out of ignorance: will the calls to player markedly affect processing time?