Variable Actor Element Rate

Hi guys, I'm trying to figure out a way to link my actors element rates to a variable. The idea is to implement a decisions system that has a direct link to an actors elemental resistances (ie. make evil decisions, become more evil, become more resistant to dark but less resistant to light).

I've had a look for a plugin that might be able to handle this but have come up with nothing. I thought I might be able to find a script call that I could use to update the elemental rates, but again nothing. Does anyone have any ideas on how I might go about doing this? There was a thread I read recently about being able to force traits on actors, but if I recollect this didn't retain changes after loading the game so isn't an ideal solution - if I can find the thread I'll post a link, might help.

Thanks in advance.
you need a plugin for dynamic traits to add to your actor.
it can't be done with simple script calls.
Thought I'd need a plugin. Thanks, Andar, I'll have a look for a dynamic trait plugin.

EDIT: Using Shaz' Dynamic Traits and Effects, thread can be closed now.

Original thread: https://forums.rpgmakerweb.com/threads/variable-actor-element-rate.103325/