Courts are expected to pass sentences which are just, in all the circumstances.
Before a custodial sentence the court must (normally) order a report and take into account the findings of the report writer when sentencing. From section 157 of the Criminal Justice Act 2003:
(1) Subject to subsection (2), in any case where the offender is or appears to be mentally disordered, the court must obtain and consider a medical report before passing a custodial sentence other than one fixed by law.
(2) Subsection (1) does not apply if, in the circumstances of the case, the court is of the opinion that it is unnecessary to obtain a medical report.
(3) Before passing a custodial sentence other than one fixed by law on an offender who is or appears to be mentally disordered, a court must consider—
(a) any information before it which relates to his mental condition (whether given in a medical report, a pre-sentence report or otherwise), and
(b) the likely effect of such a sentence on that condition and on any treatment which may be available for it.
A personality disorder on its own doesn't necessarily make any difference in sentencing, but the report writer may be of the opinion that it changes D's culpability in the circumstances of the case.