The plaintiff may, at any time, give notice in writing to the trustee that the action is discontinued against him, and no further proceedings shall be had, except that the trustee shall recover his cost, if any, to that time.
RSA 512:16
GS 230:18. GL 249:13. PS 245:15. PL 356 :15. RL 412:16.