There's not really a direct way to modify skills with a buff, but you could script something where you gain an alternate version of the skill and temporarily remove (or unmemorize) the old version, and then on losing the buff, you relearn the old skill and gain. It's not ideal, but it should work for the most part. There also may be a command to reset a cooldown of a specific skill that could be used strategically. So yes, it's possible, but you'll probably have to continue poring through the documentation and learn how to do some basic scripting (it's not that hard, really).