This is similar to an insanity defense. Peter Arenella, in the Columbia Law Review (1977 p.830), stated, "the defense [of diminished responsibility]...was first recognized by Scottish common law to reduce the punishment of the 'partially insane'." An example of a "diminished capacity" might be extremely low intelligence.
This defense usually does not necessarily result in a verdict of "not guilty"; it often results in the substitution of a lesser offence (eg manslaughter instead of murder), or a mitigated sentence.
The California Penal Code states (2002), "The defense of diminished capacity is hereby abolished ... there shall be no defense of diminished capacity, diminished responsibility, or irresistible impulse..."