In determining what sentence to pass on an offender who has pleaded guilty to an offence in proceedings before that or another court a court shall take into account—
If, as a result of taking into account any matter referred to in subsection (1) above, the court imposes a punishment on the offender which is less severe than the punishment it would otherwise have imposed, it shall state in open court that it has done so.