This is a follow up of my previous question Solution without using circular reference in google sheets?
I'm trying to create a simulator for a certain game, and part of it is determining when a character attacks and what kind of attacks it uses. Each attack takes a certain amount of time to complete, but the issue seems to be that the duration of one attack type (basic) is reduced after a certain other attack type (skill) is used. Theoretically, there shouldn't be a circular dependency, since any specific skill should affect when itself happens.
here's the example from the sample sheet:
I'll start with the section labeled "attack calculator" in columns E-I:the random number section is the input for this section, in the sample sheet, the numbers are manually entered as to not constantly change the data. The "outcome" column uses the values in the random number column to determine what kind of attack the character uses according to the formula =if(e26<5,"basic","skill")- resulting in either a basic attack or a skill (in the original sheet there's a third option: energy. it's been omitted here for simplicity). "Time when cast" gives the time in frames that the corresponding attack in the outcome column starts using the formula =h26+i26 (this is in cell h27 since the first cell is set at 0), and the duration column indicates how long that attack takes to cast. The duration of a skill is set at 60 frames, but the duration of basic attacks is based on the "basic duration" column in the skill section (A-C) and uses the formula =IF(F26="skill",60,XLOOKUP(ROUNDDOWN(H26/30)*30,A26:A35,C26:C35)).
The basic duration column uses the column next to it, "effect active?" to determine how long a basic attack takes to cast with the formula =20*(1+if(b26=TRUE,c23/100,0)). If the speed buff is active (column B is TRUE), then the duration is reduced depending on the entered value in cell c23. The "effect active?" column uses the final section on the far right of the sample sheet to determine when the skill's effect is active. (uses =OR(ARRAYFORMULA(ISBETWEEN(A26*{1;1;1;1;1;1},M$8:M$13,N$8:N$13))))
The first column of the final section (K-N) uses the data in the "helper" column to find when each skill is cast using the xlookup function. Ignore the 3 N/A error lines - the additional skills past number 3 are simply to show that more or less skills can be used, and it's not set at 3. The next column simply takes the time in the "when skills are cast" column and rounds them down to the nearest multiple of 30, mainly for simplicity. The "start skill effect" column and the "end skill effect" column are what tell the "effect active?" when the speed buff is active. the time when the effect ends is determined using the start time and the duration of the effect given in cell c22.
In the sample sheet, this causes a circular dependency (the data in the image has been manually added to avoid this), and I'm trying to figure out how to avoid this. The way I understand it - this theoretically shouldn't create an error, since any specific skill doesn't affect when itself is cast (ex: skill 1 doesn't affect when skill 1 is cast, but it does affect skill 2). Is there any way I can implement something like this to avoid needing to use iterative calculations? Or am I missing something that makes this impossible.
The issue is difficult to explain without showing the actual data, so I've attached a sample spreadsheet with an example of the data both with the formulas in and the manually-entered correct data as well as explanations of what each column does.
https://docs.google.com/spreadsheets/d/1BluBO-iC22zrgrnBSRs9RyhoYrYumhkJ8sbtlDs4iZs/edit?usp=sharing