ยง  799-a.  Notice of application for remission and discharge and costs
  on remission. An application for an  order,  as  prescribed  in  section
  seven  hundred  and  ninety-eight,  cannot  be  heard, until such notice
  thereof  as  the  court  deems  reasonable,  has  been  given   to   the
  district-attorney  of the county, and until he has had an opportunity to
  examine the matter, and prepare to  resist  the  application.  And  upon
  granting  such  an  order,  the court must always impose, as a condition
  thereof, the payment of the costs and expenses, if any, incurred  in  an
  action  or  special  proceeding  for  the collection of the fine, or the
  penalty of the recognizance.