Anyone who has given false testimony in a criminal case and retracts it in a timely manner, stating the truth so that it takes effect before a sentence is issued in the case, shall be exempt from punishment. If, as a consequence of the false testimony, the person has been deprived of liberty, the corresponding penalties shall be reduced accordingly.