It has been correctly explained that an early guilty plea attracts a maximum of a third off any sentence. As time goes on this discount is reduced. A defendant entering a guilty plea “at the door of the court” on trial day (i.e. after all the witnesses have turned up) will get 5 to 10% off.
However, there is no such thing as time off for “good behaviour” now. Prisoners serve a half of their sentence inside and the other half out on licence. Their behaviour when in prison does not alter this (unless they misbehave so badly so as to attract further criminal charges, which would be sentenced separately). The “good behaviour” discount was abandoned some years ago. Up to then prison governors could order “loss of remission” for bad behaviour, but this was ruled unacceptable because, perversely in my opinion, such action was deemed to be the imposition of an additional punishment. As prison governors did not form a properly convened tribunal their power to reduce the period of remission was removed.