[VX Ace] VE Materia - Tweak to AP

Howdy! 👋

I'm wondering if anyone could help me out with what I hopefully believe is a simple script edit to Victor's Materia script : https://victorenginescripts.wordpress.com/rpg-maker-vx-ace/materia-system/

By default, the materia gains AP upon defeating foes. I'm hoping to change it so materia instead always have their total current AP equal to the equipped character's level.

For example, if I have a BLAZE materia equipped to actor1 (LV.20), the materia's total AP would be set to 20. If I then swapped it to actor2 (LV.5), it would change it's total AP to 5. When not equipped to any actor, it would be set to 0 AP.

I've made a couple small tweaks that, while I don't think any would affect the change to AP gain, I figured I should include just in case. I had to add it as a .txt file, since the forums wouldn't let me post a script that long. 😛

Hopefully this makes sense. Let me know if you have any questions.

Thank you!
Bump 🙏

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-ve-materia-tweak-to-ap.109113/