This is fairly simple.
You would like to stipulate within that sworn statement that in consideration for execution of this statement case xxx in xxx court is dismissed. You could include a provision for monetary damages if you like should they not drop it.
This should take no more than an hour or two of a lawyers time to draft. You would do very well to consult one. If you are indigant, consult Legal Aid.