When several actions are brought on one bond, undertaking, promissory note, bill of exchange, or other instrument in writing, or in any other case for the same cause of action, against several parties who might have been joined as defendants in the same action, no costs can be allowed to the plaintiff in more than one of such actions, which may be at his election, if the party proceeded against in the other actions were, at the commencement of the previous action, openly within this State; but the disbursements of the plaintiff must be allowed to him in each action.