(1) In cases under section 81 and section 82 the court in its discretion may mitigate the sentence (section 49(2)) or order a discharge if the offender voluntarily gives up the further commission of the offence and averts or substantially lessens any danger known to him that others will continue with the commission or if he voluntarily prevents the completion of the offence.
(2) In cases under section 83 the court may proceed according to subsection (1) above if the offender voluntarily gives up his plan and averts or substantially lessens a danger known and caused by him that others will further prepare or continue with the commission or if he voluntarily prevents the completion of the offence.
(3) If the danger is averted or substantially lessened or the completion of the offence is prevented regardless of the contribution of the offender his voluntary and earnest effort to avert or lessen the danger or to prevent the completion of the offence shall suffice.