MV Yanfly Event Foraging System

Alright, I am back with another silly question to do with yanfly. Essentially, I have gotten my farming of crops to the point of I can till the earth, I can put a seed in the earth, and I can water a seeded area. After I run my "bed" common event, it updates the water self variable. However, I would like the option where if the player does not water the crop, it will die after 3 days of not being water (essentially, the player could water the crop, but after being insufficiently watered for 3 days, it would die).

Screen Shot 2023-05-02 at 11.50.58 PM.png
This is my plant water respawn common event. It works in regard to updating the variable "var Id", but it won't update deathId. I figure this may be because the help file using "varId" in the example, so it may be something hardcoded into the plugin, but I am unsure.

Screen Shot 2023-05-02 at 11.51.06 PM.png
This is the update part to check the map (the map is correct and this works fine).

Screen Shot 2023-05-02 at 11.51.38 PM.png
Screen Shot 2023-05-03 at 12.00.41 AM.png

This is also the water plant common event where I think the second problem lies. Essentially, I cannot set a value per say as the event runs this as a parallel process. I'm assuming if I set the value to 0 at the very top it would just repeat and keep returning the value to 0.

TL;DR: How do I check 2 self variables with the yanfly foraging event tutorial as a guide? Would it be something that I need to do one as a self variable and the other as a switch, and if so, how would that look? Thank you so much in advance!!
Just looking at your javascript code, you are both getting the values of self switch 26 (and saving it to the variable "value") and self switch 30 (and saving it to the variable "death"). Then you perform some checks and manipulate this "value" variable. Finally you update the value of self switch 26 with that of the "value" variable.
You never do anything with your "death" variable. No wonder nothing happens with it.
Just looking at your javascript code, you are both getting the values of self switch 26 (and saving it to the variable "value") and self switch 30 (and saving it to the variable "death"). Then you perform some checks and manipulate this "value" variable. Finally you update the value of self switch 26 with that of the "value" variable.
You never do anything with your "death" variable. No wonder nothing happens with it.
Gosh how silly am I? I was up until 1 AM losing my marbles over why it wasn’t updating! Thank you so much! Im going to make sure this works before I fully close the thread, but thank you so much!!!

EDIT: It worked!! For anyone else in the future, this is how the script looks now!

Screen Shot 2023-05-03 at 11.40.30 AM.png


I had to change the order of the if statements as it would always kill the plants if the death variable was in front! Again, thank you so much @eomereolsson for catching my silly mistake!!
This thread is being closed due to being solved. If you would like to reopened, report it and let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-event-foraging-system.157170/