Have you visually inspected the charging port, with a magnifying glass, to ensure that the connecting pins are straight and parallel (not damaged in other words) and that there is no foreign matter in the port enclosure.
Also with the charger connected does to port feel secure if you gently (stress gently) move the cord from side to side or up and down? In other words does it feel loose?
Here is a link to a video which shows how to dis-assemble a Moto X. I'm not sure if this is your exact model. You may have to search further to verify. Once dis-assembled you should have access to the USB port.
It looks as though the port is surface mounted on the systemboard so you will need the appropriate skills if you wish to replace it. Once you have found the correct type of USB connector of course.
If you have any doubts take it to a reputable, professional mobile phone repair service and have them do it.