The easy part would be making a weapon give you experience in a skill.
Create a CustomClass : Verb_Shoot and override WarmupComplete() such that base.CasterPawn.skills.Learn(SkillDefOf.Shooting, xp, false); is your chosen SkillDefOf. Assign this verb to the weapon in XML.
Then, harder is making a custom static CustomClass based on ShotReport where HitReportFor() contains f = pawn.GetStatValue(StatDefOf.ShootingAccuracy, true); with your chosen StatDefOf and defining a StatDef (XML) like MagicAccuracy or something and making a StatWorker for the stat so it's influenced by your chosen skill.
Create a CustomClass : Verb_Shoot and override WarmupComplete() such that base.CasterPawn.skills.Learn(SkillDefOf.Shooting, xp, false); is your chosen SkillDefOf. Assign this verb to the weapon in XML.
Then, harder is making a custom static CustomClass based on ShotReport where HitReportFor() contains f = pawn.GetStatValue(StatDefOf.ShootingAccuracy, true); with your chosen StatDefOf and defining a StatDef (XML) like MagicAccuracy or something and making a StatWorker for the stat so it's influenced by your chosen skill.