Welcome to Just Answer. I am here to help you resolve your tax and finance concerns. Please feel free to ask anytime you need extra help.
You will need to file a New Jersey return because you live there. Your NYC job income will be taxed by NJ but you are able to take a credit on the NJ return for taxes paid to NYS/NYC.
You will be need to file a NY return (including NYC) because that is the source of your income.
You will not be required to file a Massachusetts return because you are only there on temporary assignment for your NYC job and your income source is not from Mass.