The enemy showcases three distinct states – dodging, advancing, and recharging. When it is not doing one of these three, its “idle” state is steadily moving back and forth and firing shots at a rhythmic pace.
The enemy’s total health in conjunction with its quantitative distance from the player act to determine the frequency of when its states are called. For example, if the enemy’s health is low, it will attempt to recharge and strafe more frequently, but its distance from the player has the final say in whether the state is even executable.
With both variables interacting with one another, the state probabilities are in constant flux, simulating spontaneous behavior. I’m still unsure of what my exact formula will be to determine frequency, but I’m pointing in the direction of either a modulo timer with a changing limit or a randomizer with a changing scale (or a combination of the two).