It would be cheaper to just buy another P99. I checked into this a couple of years ago. The cost of a new barrel and slide was the same as a brand new gun. With the new gun, you'd get the magazines too.
If you just get a barrel, you'll need to make sure it's the same length as the .40's barrel and as thick. The barrel and slide of the .40 is longer than the 9mm.