I currently have a gameobject (Ally) with a script attached to it, and a child gameobject (Ability) with another script. The ally gameobject has some variables (health / attack etc.) and I want to modify those values with a method inside the child gameobject’s script (Ability) (increase both health and attack by 2). I just can’t figure out how to do this. The problem is that the ally and ability gameobject are created at runtime, and not at the same time. (the ally could be created without the ability, or with a different ability).
this is straightforward - you really need to understand how unity handles game objects and components. scripts are much like any other component.
in your case, first check whether the game object exists then use GetComponent to get a script reference then handle accordingly.
a little research will save you a lot of time… start here.
After creation, find the child from the parent with transform.FindChild, and then use GetComponent() on it.