You can set various conditions and requirements on skills, but not really something like a random chance for it to work. Maybe you could script something where on combat starting, you learn a certain skill with a certain chance, but that would take some finagling. See here for some information about skill creation:

https://docs.larian.game/Skill_creation