Plaintiff may discontinue: defence may be withdrawn
(1) The plaintiff may, at any time before receipt of the defendant's defence, or after the receipt thereof before taking any other step in the action, by notice in writing, wholly discontinue his action against all or any of the defendants or withdraw any part or parts of his alleged cause of complaint, and thereupon he shall pay such defendant's costs of the action, or, if the action be not wholly discontinued, the costs occasioned by the matter so withdrawn.
(2) The costs referred to in paragraph (1) shall be taxed, and such discontinuance or withdrawal, as the case may be, shall not be a defence to any subsequent action.
(3) Save as in this Rule otherwise provided, it shall not be competent for the plaintiff to withdraw the record or discontinue the action without leave of the Court, but the Court may before, or at, or after the hearing or trial, upon such terms as to costs, and as to any other action, and otherwise, as may be just, order the action to be discontinued, or any part of the alleged cause of complaint to be struck out.
(4) The Court may, in like manner, and with the like discretion as to terms, upon the application of a defendant, order the whole or any part of his alleged grounds of defence or counterclaim to be withdrawn or struck out, but it shall not be competent to a defendant to withdraw his defence or counterclaim, or any part thereof, without such leave.