$dataItems is just the array that you set up in the Items database. That just holds a description of each item.
Here's an easy way to find out stuff like this ... find an event command that does it, then look at the code to see what the event command does. rpg_objects.js and Game_Interpreter right towards the bottom, is the place to go for such a search.
For this example, the event page has a condition to make that page active if the party has a certain item. If you look at the Game_Event code you'll see a meetsConditions function, and the part that does the item check looks like this:
Code:
var item = $dataItems[c.itemId];
if (!$gameParty.hasItem(item)) {
return false;
}
So it's using an item id to retrieve the element from the $dataItems array with that id. So the
item var is an actual item, not an item id. Then it simply calls the $gameParty.hasItem function, passing in the item you're testing for.
Note that the Game_Party.hasItem function has two arguments. The second,
includeEquip, defaults to
false if not passed in. For items, that's not a problem, as you normally can't equip items. But if you were interested in armor or weapons, you'd need to pass in
true as a second argument if you wanted it to consider equipment as well.
There is also a test in the Conditional Branch event command to see if the party has a certain item in their inventory, and Control Variables also puts the number being carried into a variable. For both of these, you could look at Game_Interpreter to see what happens behind the scenes - that's the class that processes all the event commands.
For your other question ... $gameParty.members() returns an array of members. [ID] is just looking at a certain element in that array. 0 is the first element in that array, which is your party leader (the ID is not the actor id, it is the index, or order, of actors in your party - so ID is probably not a good variable name to use in this case). If you want to refer to an actor id, and you don't care where they are in the party, you would be after $gameActors.actor(id)
There is no simple way to learn all of this quickly. It's a matter of looking in the most likely place for each situation, and gradually, over time, you'll get better and faster at it, and you'll remember things and not need to look them up. There really is no shortcut.