MV Yanfly STB System & SRD Timed Attack Conflict (SOLVED)

TypeError: Cannot read property 'isActor' of null

If an actor has a status effect that causes them to skip a turn (ex. sleep), the error comes up. I only found one other thread discussing this specific problem and it wasn't solved. After experimenting I believe the issue is with the SRD Timed Attack Core since it's the first plugin on the error list to pop up - [at Function.BattleManager.startAction (SRD_TimedAttackCore.js:464:19)].

Untitled.png


Rearranging the order of plugins did not solve the issue. Putting SRD before Yanfly prevents SRD from working, and placing it between the Battle Engine Core and STB System didn't work. STB System works when SRD Timed Attack turned off. SRD Timed Attack works when STB System is turned off. I have Yanfly's plugins listed in recommended order as seen here. SRD's Mash extension doesn't have anything to do with it since I still get the error when it's off.

Untitled.png


I don't know what to change in the code so any help would be appreciated.
I looked into the code itself, and using the numbers provided in the error I found this.

var _BattleManager_startAction = BattleManager.startAction; BattleManager.startAction = function() { _BattleManager_startAction.call(this); if(this._subject.isActor() && this._subject.currentAction() && this._subject.currentAction().makeTargets()) { var subject = this._subject; var action = subject.currentAction(); var targets = action.makeTargets(); this[_.pass + "Temp Subject"] = subject; this[_.pass + "Temp Action"] = action; this[_.pass + "Temp Targets"] = targets; $gameTemp.setTemporarilyDisableLogWindow(true); this._logWindow.push('performActionStart', subject, action);

I believe the 'isActor' is referring to an issue with this part. Normally turns would be pre-selected, but with STB that doesn't happen since you're meant to move directly on to the next person, and therefore skipping a turn is causing an issue somehow. I haven't run into any other conflicts using the two plugins together. You can still get SRD's Timed Attack plugin here if you want to look at the whole thing and see where I got it from.
Added the full error list. Not sure if it will help, but it's better than nothing.
Bump
Replace:
if(this._subject.isActor() && this._subject.currentAction() && this._subject.currentAction().makeTargets()) {

with:
if(this._subject && this._subject.isActor() && this._subject.currentAction() && this._subject.currentAction().makeTargets()) {
It worked! Thank you so much!
Thank you very much! That solved an issue with my game that I was struggling with for over a year!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-stb-system-srd-timed-attack-conflict-solved.142079/