Credit from state for social security/retirement paid to federal government

Hello!

 

I am filing my state taxes (nonresident) for MA, and came across this:

 

"Enter the amount paid to Social Security (FICA), Medicare or Railroad Retirement, and the U.S. or Massachusetts Retirement Systems that is shown on your W-2(s) that is directly related to income taxable by Massachusetts"

 

(The instructions for this section, on the MA website, also state this: "Be sure to add any amount of Medicare tax withheld as shown on Form W-2 and any amount of self-employment tax as reported on your U.S. Form 1040 to the amount of Social Security tax withheld, the total not to exceed $2,000 per person.")

 

I recently filed my federal taxes, and paid $1320 in self-employment tax. $1,267 of that was from work done in MA. From previous years, I know that the amount I put in this section is credited toward me (taken off of the taxes that I owe to MA). I just want to double-check that I'm doing it right. Is it correct that the $1,267 that I paid in self-employment tax to the federal government is considered to be a payment to the social security/U.S. retirement system, and thus I can put that entire amount of $1,267 in this section? (I know 12.4% of SE tax goes toward social security - does the other 2.9% toward Medicare count, too?)

 

Also, to add another layer to that, this year I received an earned income credit of $1,347 from the federal government, and am thus receiving a refund. Even with this credit, am I still considered to have paid self-employment tax, and should I still enter the amount of $1,267 in this section?

 

Thank you for your help!