TypeError: "Cannot read property 'isEnemy' of null, When the skill use by the enemies

So guys. I always get the error: TypeError: "Cannot read property 'isEnemy' of null. When some skill that i got from some forum here is use by the enemy.

I have many skill here so i can't show the code. But if it is necessary i'm willing to show the codes that i got for free.
Can someone tell me what the cause of it's error? I'm willing to look forward and read the codes if i'm aware of the cause of the error. Thanks.

Note: The error doesn't show when the skills uses by the character/allies.
Please include the full screenshot of the error. This can be seen by pressing F8 when the game crashes.

What is the context? i.e. can you describe when this error occurs?
You'll have to post the code too, else we will only be guessing. Please post the code for the skill that you found. Odds are it was only meant to be used by an ally which is why it is throwing that error.

I've moved this thread to JavaScript Support. Thank you.

Make sure you start a new game (save file).
You'll have to post the code too, else we will only be guessing. Please post the code for the skill that you found. Odds are it was only meant to be used by an ally which is why it is throwing that error.

Moved to: JavaScript Support

Code:
<Cooldown: 4>

<follow action>
animation 43: friends
wait for animation
animation 45: friend 0
wait: 15
se: play recovery
hp +25%: friend 0, show
animation 45: friend 1
wait: 15
se: play recovery
hp +25%: friend 1, show
animation 45: friend 2
wait: 15
se: play recovery
hp +25%: friend 2, show
animation 45: friend 3
wait: 15
se: play recovery
hp +25%: friend 3, show
</follow action>
Please include the full screenshot of the error. This can be seen by pressing F8 when the game crashes.

What is the context? i.e. can you describe when this error occurs?
Here is the full screenshot of error:
Also, The enemy is using an animated battler. but sometimes it also happen even the enemy is static/not animated.
Double-post notice: Loydiee
A double post is where you post immediately under yourself without a 72 hour gap.
If you want to add something, just use the Edit button and put the additional info/comment in your earlier post.
Double-post notice: Loydiee
A double post is where you post immediately under yourself without a 72 hour gap.
If you want to add something, just use the Edit button and put the additional info/comment in your earlier post.
I'm so sorry. My internet quite slow so I accidentally double posts.
The thing I noticed is the skill seems to require there to be 4 total in the battle party when it is used based on the animations it shows. When it crashes on you, are there less than 4 enemies present when the enemy is trying to use it?
The thing I noticed is the skill seems to require there to be 4 total in the battle party when it is used based on the animations it shows. When it crashes on you, are there less than 4 enemies present when the enemy is trying to use it?
I don't think so. It always crash when i fought against animated battlers like actors. And they are still '4' but sometimes it's also happen when i fought only 3 or below but animated battlers. I think the animated battlers is the problem. As I saw the errors.
1. Based on your previous posts, it's not clear whether the issue is 100% related to the animation of the battlers.
Spoiler
but sometimes it also happen even the enemy is static/not animated.
It always crash when i fought against animated battlers like actors.

Can you try disabling the Animated Sideview plugin and see if the skill works as expected?

2. I read the code of the Yanfly Animated Sideview Battlers plugin at the parts of the error you posted. The crash is occurring when the animation is trying to display on a target that does not exist. I think @bgillisp is correct. If there are only 2 enemies left, then "friend 2" and "friend 3" do not exist.

3. You don't have to quote somebody's full message every time you respond. I suspect you are clicking the small "reply" button, you don't need to do that. If you want to quote somebody, just quote the parts that are relevant, or to respond to a specific person you can tag them with the @ symbol. [like how I tagged bgillisp above]

Original thread: https://forums.rpgmakerweb.com/threads/typeerror-cannot-read-property-isenemy-of-null-when-the-skill-use-by-the-enemies.93922/