Can the mentally ill truly sin?

"Of course!" we say, because being mentally ill does not absolve someone from responsibility for their actions. And yet...

If someone has a schizophrenic breakdown and assaults (or even murders) someone, is that sinful?

If someone afflicted with severe depression, whose mind if warped by a hormonal imbalance, and they profane the name of God in their desapir, are they actually sinning or just sick?

At what point does a person have the mental capacity and acuity to sin? We know babies can't sin. But when's the magic line?

----

It is conceivable that someone could remain mentally ill or limited in such a way that they commit acts recognizable as "sin", but because of their limitations they are effectively sinless? How can we fairly ascribe sin to someone who has no capacity to understand their actions or whose actions are driven by debilitating illness?