When a defendant in action has interposed an answer, as a defense, setoff or counterclaim, upon which he would be entitled to reply in such action, the remedy upon which, at the time of the commencement of such action, was not barred by law, and such complaint is dismissed, or the action is discontinued, the time which intervened between the commencement and the termination of such action shall not be deemed a part of the time limited for the commencement of an action by the defendant, to recover for the cause of action so interposed as a defense, setoff or counterclaim.
§ 516.370, RSMo