Create Issue Fields Dynamic requirements

I want to write a code that will make field requiered depending on state of different field state upon the creation of issue. Example: If Issue type is bug or collab bug and component is Support than make priority field required. I totally have no idea how to implement this. I’m using atlassian-plugin-sdk-8.0.16 in add-on plugin project. I would be very gratefull for any hints or tips where to start. I’ve just started working with Jira so please forgive me my lack of knowledge.

For now I’ve managed to check this conditions in onIssueCreate event but this one is invoked after issue is already created, so it did not solve my problem.