You have just put your finger on the issue. People suffering from mental or medical problems, or both, are probably not in any physical or mental position to defend themselves. However, that is what they are required to do under the current rules.
Not only do these people not have the right to counsel or to any representation, they also do not necessarily know the rules of procedure. There really aren't any. Even if they wanted to use their medical condition in their arguments before their commander, who would be acting as judge in this situation, they would not be able to present these arguments very effectively.
Does the commander who is acting as judge have to take medical condition into consideration in sentencing? There is nothing set out about this, because there are not really any rules of procedure. It will depend on the circumstances and how the judge is feeling. It will depend on the witness, who is standing at attention while being escorted. Is he or she going to sit down and start disclosing the medical condition?
These are not trials with normal rules. The normal rules you are alluding to do not exist in these situations.