Your sensor should be held to your valve stem by a tiny torx screw, on the inside of the wheel. Replacing the valve stem is not mandatory, though a good idea. The sensor has to be programed to the vehicle, and the wheel position. There are ways to put the vehicle in "learn" mode and then going around the vehicle in a specific order letting air out of the tires till the horn beeps then moving to the next wheel. The sensors have basically a watch battery potted in epoxy (can't change just the battery) and last 7 to 10 years. I usually suggest changing all 4 sensors at the same time, if one battery is dead the rest are not far behind. You can save labor if you wait till you need new tires, as your tires will be being removed anyway.
Your sensor was NOT damaged by road derbies, rocks, or anything else that did not destroy your tire.
Sensor replacement usually costs $60 to $100 where I work, depending if you are getting new tires, and which exact sensor type it is. That includes all required programing.