The sheriff is not required to pay any filing fee, cost, bond or security, as may otherwise be required of other civil litigants by provisions of this code, in any action in which the sheriff commences the action in his or her official capacity or on behalf of the county government: Provided, That where the sheriff or county government prevails in the action and any filing fees, costs, bond or security are recovered from the opposing party, the sheriff shall pay therefrom the fees, costs, bond or security to the officer who otherwise would have been entitled thereto but for the provisions of this section: Provided, however, That any legal fees and costs not so recovered from the opposing party shall be paid out of the taxes so collected prior to the distribution of the taxes to the various taxing units.
W. Va. Code § 7-5-24