(1) A plaintiff, by notice, may discontinue, wholly or in part, an action against a defendant (a) at any time before delivery of a defence; or(b) after the delivery of a defence and before taking any other step in the action, other than making an interlocutory application.(2) At any time before judgment, the Court or a judge may grant leave (a) to a plaintiff to discontinue, wholly or in part, an action against all or any of the defendants; or(b) to a defendant to discontinue, wholly or in part, a counterclaim against all or any of the defendants to the counterclaim.(3) Leave may be granted on any terms as may be just.