Help figuring out the best way to handle specific triggers for advancements

Need help figuring out - giving an advancement to a player for giving another player a specific item, giving a player an advancement for having atleast a certain amount of hostile mobs within a certain distance of them I'm using a mix of Misode's Advancement Generator and MCreator to put this together currently. I haven't really dabbled with Advancements or Datapacks much so I'm not sure what limits there are when it comes to this stuff, but I'm hoping to find help here! I've attempted the first one already, but when trying to set it up, it allowed me to drop myself the item for the advancement at first, but it also gives the advancement to the person who picked it up rather than who threw it. The second one, I'm wanting to make it so if there's atleast 15 hostile mobs around a player within like... 20 blocks, it would give an advancement. I'm feeling like I would need to use scoreboards or something for that one, but I'm not entirely sure. Though I know how to set such things up. I'm just lost on what would be the best way to handle this, if any.
Continue to help post