I appears you are questioning the NYS/NYC mortgage recording fee at $4/$1k. Technically it is not a tax, but accountants write it off because it is a tax!
This fee is based on the amount of the mortgage. The recorded mortgage documents can be "assigned" from mortgage to mortgage. Some lenders will not cooperate and not send the originally recorded documents to the closing attorney. The originally recorded documents are a requirement are the only documents that can be assigned to the new mortgage/lender.
This assignment is limited to a particular property.The new fee is based on the difference between the current outstanding mortgage balance on the property and the new mortgage amount. This assignment occurs at the closing and the title company picks up the recording fee at that time.
As far as I know, no refunds available. I don't believe that our state or city would refund you any fees that they collected for a legitimate transaction.