Add this to have the skill go up.
Code:
//See if the player increases their skill
float wisebonus = (pp.WIS > 200) ? 20 + ((pp.WIS - 200) * 0.05) : pp.WIS * 0.1;
if ((55-(GetSkill(FORAGE)*0.236))+wisebonus > (float)rand()/RAND_MAX*100)
this->SetSkill(FORAGE,++pp.skills[FORAGE]);