Need help translating command block logic into datapacks

While trying to create a simple mob count I encountered a roadblock in the form of datapacks lacking command block logic like conditions, single running commands, etc. Could I have an explanation of how datapacks circumnavigate/recreate these features? I have watched some tutorials that mention storing the success of a function but they were confusing.

Continue to help post