The simplest single line you can get is...
if GetUnitAbilityLevel(GetKillingUnit(), 'B000') > 0 and GetInventoryIndexOfItemTypeBJ(GetKillingUnit(), 'I000') > 0 then
If you mean logically, then this more efficient...
// locals go at start of function
local unit u = GetKillingUnit()
local integer i = 0
local item w
// after local initialization
// find if unit has an item of that type
loop
set w = UnitItemInSlot(u, i)
if w != null and GetItemTypeId(w) == 'I000' then
exitwhen true
endif
set i = i + 1
exitwhen i >= bj_MAX_INVENTORY
endloop
// perform test
if GetUnitAbilityLevel(u, 'B000') > 0 and i < bj_MAX_INVENTORY then
// your code here
endif
// handle cleanup
set i = null
set u = null
The one native does not inline. You need to recreate the logic of the function in your function.
You also need to be aware that GetInventoryIndexOfItemTypeBJ may have a handle leak in it if items get destroyed.