In case of the payment of money under mistake of law or fact upon any illegal tax assessment made under color of any law, special or general, of the state, or by any of its political subdivisions, authorizing the assessment or collection of taxes for any purpose whatever, whether for any municipality, for the payment of the creditors of any municipality, for schools, or otherwise, except the laws relating to taxes to be paid to the state or to the general funds of the counties, respectively, the same shall be recoverable by appropriate proceedings against the proper parties or their successors, with the usual rights of appeal, and that such payment was not made under compulsion or protest shall be immaterial.