Suppose we have these sentences:
1. Smiling, she offered me a hot cup of chocolate.
2. Busy finishing my homework, I have no time to even think about video games.
3. Knowing there's little change of being selected, Tim did not try out for the team.
4. Having visited NYC, now I know what real cities are like
5. Happily, he took my advice.
In the 5 sentences above, we have gerunds ("smiling", "knowing there's little change of being selected"), adjective ("busy finishing my homework"), verb participle form ("having visited NYC"), and adjective ("happily") all describing a certain state of being of the subject.
What is the formal name for such a grammatical element/structure?