I am not sure if you can mod a companions weapon. And, they will only use a weapon that you give them, that is modded or not, if it has higher damage than the one they are carrying. Most Companions have buffed out weapons already. So, it may not be of any benifit to try this.
Now, you are doing the modding right by using the X Button (assuming PC here) in the Weapons list in your Pipboy Inventory? I ask this because it took me a bit to figure out how to mod guns in this game.
Maria is the unique 9mm pistol you get from Benny, not a companion.
OP, I thought the same way when I tried that, and was pretty ticked off when i couldn't mod Maria at all. I reall y wish you could, it would come in handy.