You would need to contact a expert to have a psychiatric review on your friend or is there any previous reports that could show her persistent mentally disorder condition?
I would not say this mentally uncontrollable condition is an advantage for your friend to defend herself from the criminal charge, but it would be a mitigating factor to have the sentence be reduced. If mental disorder can be used as a complete defence for a criminal offence, there would be no justice.

