Thank you for giving me the opportunity to assist you. I will give the best answer that I can with the information provided.
Loan modification fees for your primary residence are not deductible.
Refinance fees are not generally deductible, and amounts resulting in higher interest would not be deductible up front, but the additional interest is deductible over the term of the loan.
The only deductible type fees in these situations is if you pay "points" or "origination fees" that are expressed in a percentage of the loan amount---but they must be amortized over the life of the loan, or possibly, if you paid mortgage insurance premiums.
Please let me know if you need additional information.
Thanks for this; very helpful. A follow up question on the loan modification fees:
What is the difference between a loan modification fee to reduce my interest rate and paying "points" in connection with refinancing a loan? Since my loan would presumably deemed to be reissued for tax purposes as a result of the reduction of the interest rate by 500 bps, could this 1500 fee simply be viewed as a point on a refi?
There are multiple different types of fees that are thrown around as terms when discussing loan modification or refinance. There are lender fees, appraisal fees, title fees, legal fees, etc. Most of these are not deductible. However, the term points generally refers to prepaid interest--the purpose of which is to get a lower rate (I've never heard of points paid to get a higher rate).
Sometimes points can be known as "Loan origination fees" "maximum loan charges", "loan discount" or "discount points". The points are generally expressed as a percentage of the principal amount of the mortgage. For example, if the amount of the refinance (new loan), is $150,000, and to get a certain rate, you are paying 1 point (or 1% of the principal $1500) then that fee would be deductible---but since it is a refinance, it would have to be deducted ratably over the life of the loan.
For more specific and examples, see:
page 5: http://www.irs.gov/pub/irs-pdf/p936.pdf