I knock off 25% from the base cost, then it's half of that. Same for xp, but you'd need to pay for the xp (which is 5 gp per 1 xp), and tack that on to the price.
For example, a +1 sword. 2000 for +1 enhancement, 300 for masterwork, and lets say 10 for the weapon. 2310 is the base cost, down to 1732.5 after reduction of the base amount, then 1/2 of that for gp and 1/25 that for xp: 866.25 gp, 69.3 xp. But we have to calculate out the xp into gp, which is a 5:1 ratio, or 346.5 gp. So the cost for one of us to craft it would be 1212.75 gp, as opposed to 1617 if you crafted it yourself.
Assuming I didnt screw anything up there...
So basically it's: [(base cost - 25%)/2] + 5*[(base cost - 25%)/25]
Oh, and I can only make scrolls, potions, wands, and magic arms/armor. I cant make wondrous items or staves or anything.