The plaintiff may of right amend his declaration or bill at any time before the appearance of the defendant; and, notwithstanding such appearance, in any action, suit, motion or other proceeding, the court, if in its opinion substantial justice will be promoted thereby, may, at any time before final judgment or decree, and upon such terms as it may deem just, permit any pleading to be amended, or material supplemental matter to be set forth in amended or supplemental pleadings, introducing a necessary party, discontinuing as to a party, eliminating from a multifarious bill all but one of the equitable causes of action alleged, or changing the form but not the cause of action, except that no proceeding by motion shall be converted by amendment into a formal action at law, or vice versa, and the court may allow any other amendment in matter of form or substance in any process which is not void, pleading or proceeding, which may enable the plaintiff to sustain the action, suit, motion or proceeding for the cause for which it was intended to be brought, or enable the defendant to make full and complete defense.