In all cases, where any action is voluntarily dismissed by the plaintiff or is dismissed for want of prosecution by reason that the plaintiff neglects to prosecute the same, the defendant shall recover judgment for his or her costs, to be taxed and to be collected in the same manner as judgments for the payment of money are enforced.
735 ILCS 5/5-116