This script is now safe to use. I fixed a few typos and replaced some code in the Ability Capsule script, and completely fixed the Ability Patch one. I have personally tested nearly every facet of the code, and it works flawlessly. The code for Essentials v19.1 gets the Ability name via some code that only exists in Essentials v19 and up, so I had to make do without those functions. As a result, a generic message is shown for the confirmation of using the items, which only contains the name of the Pokemon it is used on as a parameter.
The only thing I did not test as of posting this is whether or not choosing not to use the item works properly, but it should work. If not, please leave a comment letting me know, and I will fix it ASAP.